package com.comtop.springboot.templet.common.validator;

import com.comtop.springboot.templet.common.exception.CustomException;
import com.xiaoleilu.hutool.util.StrUtil;

/**
 * 数据校验
 * @author wangjiafang
 * @version 1.0
 * @since 2017-03-23 15:50
 */
public abstract class Assert {

    public static void isBlank(String str, String message) {
        if (StrUtil.isBlank(str)) {
            throw new CustomException(message);
        }
    }

    public static void isNull(Object object, String message) {
        if (object == null) {
            throw new CustomException(message);
        }
    }
}
